package org.fastiot.gateway.client

import io.netty.buffer.ByteBuf
import io.netty.channel.ChannelHandlerContext
import io.netty.handler.codec.MessageToByteEncoder

class BytePacketEncoder extends MessageToByteEncoder<Byte[]> {
    @Override
    protected void encode(final ChannelHandlerContext ctx, final Byte[] msg, final ByteBuf out) throws Exception {
        println "client.BytePacketEncoder#encode:${msg.encodeHex()}"
        out.writeBytes(msg)
        ctx.flush()
    }
}
